UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7aZdwLSQo5ieeX9Qo/hYEp/GFih6Hn2Ipq4GiiZxF5E='
WHERE
key_id = 'e0ec47d0ca3e2f79dd0beb1a9c08fcf978158764009905721fabe8af25acf8da'
AND (
token = '7aZdwLSQo5ieeX9Qo/hYEp/GFih6Hn2Ipq4GiiZxF5E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)