UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'COee+pVCncHLg2Xz2MC4Czy//VFUZWcaaxTsPNIe6/c='
WHERE
key_id = 'e11a85ce54e12c49f1bbc9060c8fa8bea6ee97222a5e6fe9511e2fdf8b88c65c'
AND (
token = 'COee+pVCncHLg2Xz2MC4Czy//VFUZWcaaxTsPNIe6/c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)