UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4Iy9ac+SJ4WwFMOxMPDQwcwmHFSpmKIoMTmmOQIKNTI='
WHERE
key_id = '2d31c641df607f8d6272803c91d635c6fa0c85a035be0b663a54aa0f8c0654b0'
AND (
token = '4Iy9ac+SJ4WwFMOxMPDQwcwmHFSpmKIoMTmmOQIKNTI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)