UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lIHU1UFnufoz73MpADtOD/1de/0dkJlj5iuk2YgpzEM='
WHERE
key_id = '16620005282d01814f950b6d61589ff6f9e15854c2a205829411f2a63d31e28b'
AND (
token = 'lIHU1UFnufoz73MpADtOD/1de/0dkJlj5iuk2YgpzEM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)