UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iEbFBjMLeQGoeWEa5i06/g3Cv2QtzOqYLU6PFDNVBHs='
WHERE
key_id = '503a18d93791cac405f5cbc86d42cb73fa1e23b683a4d7380d708bbcfcc876e7'
AND (
token = 'iEbFBjMLeQGoeWEa5i06/g3Cv2QtzOqYLU6PFDNVBHs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)