UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oerdE2KobEKfTaFFKv9B8LY3mcdDvWeRMK96KqM3IDk='
WHERE
key_id = 'c5b0a09dcdccb0ed096d8b682f7131d8436d22374b055b2fdb3ecdcbf55fcae1'
AND (
token = 'oerdE2KobEKfTaFFKv9B8LY3mcdDvWeRMK96KqM3IDk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)