UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2F35jZ4v56VmU2yPEraeIOF0Q//FjqumMThPVF7Z6fs='
WHERE
key_id = '0301526e319bba52443ddef1410d9899f8a3fec2129e3b4995241ed52dce3055'
AND (
token = '2F35jZ4v56VmU2yPEraeIOF0Q//FjqumMThPVF7Z6fs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)