UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EbzCKm+aMuRej1WzamxtTGe38Oknm0D2u4HEeKzvXU8='
WHERE
key_id = '5d6c36722418f6f96bd35ac11095afe9846269c8f6ddc1e5418d27a21a86f967'
AND (
token = 'EbzCKm+aMuRej1WzamxtTGe38Oknm0D2u4HEeKzvXU8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)