UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UE/xf/uHVlBXvES5QvU3p2XT7NOZBh3lgVNVKfVqFkk='
WHERE
key_id = '2729a80d331736d2dc5a0ad095e0b7fa79708b3fce858459bf4fed6122eb2895'
AND (
token = 'UE/xf/uHVlBXvES5QvU3p2XT7NOZBh3lgVNVKfVqFkk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)