UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GaiY3fwLusOhSasUDXSyN0ySfgahuge5D/uME14ThRk='
WHERE
key_id = 'b56901643bfc545b67f4f7ba5941a455b561cb9cc7749a9b7cad660887b83b5f'
AND (
token = 'GaiY3fwLusOhSasUDXSyN0ySfgahuge5D/uME14ThRk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)