UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'shh+Ko5rg7VpAxUxYyrAowSTEIuK4YZDGYoaevlSopo='
WHERE
key_id = 'aed08e108874eb2b7bb59834b6b10cd89e84ba724137fabe289d0b6fd6672879'
AND (
token = 'shh+Ko5rg7VpAxUxYyrAowSTEIuK4YZDGYoaevlSopo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)