UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8m6CNqutVx0y/3aADl6kDpuOlPhO0UyxaxigWarqxvY='
WHERE
key_id = '50536dcd02af64df1d85bcffd96d3c624c1dd1afe638765c3c8b72cc7128d45b'
AND (
token = '8m6CNqutVx0y/3aADl6kDpuOlPhO0UyxaxigWarqxvY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)