UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4Qpa2TV8PEHNBx1RFW1L3JTo9N76bW0V6L6us5Peqhs='
WHERE
key_id = 'a28acc9e118aedaee5597183fd647eca56c46cba2ae24a8f55124b4051d2be90'
AND (
token = '4Qpa2TV8PEHNBx1RFW1L3JTo9N76bW0V6L6us5Peqhs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)