UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PWvJl15Y8z1lyVgz1ZBP7bOMe+yEwGCrRDZXGm3v8oM='
WHERE
key_id = '5c74cc36f9ca94ab054693658411609b150cbe7c3c62cc7a03d5577107ce1fa3'
AND (
token = 'PWvJl15Y8z1lyVgz1ZBP7bOMe+yEwGCrRDZXGm3v8oM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)