UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xzHagyF7Z2WwXWrPejFZAJw0b+NWpo/WgWqcRbp09KQ='
WHERE
key_id = 'e38574db552e82d11625363aeb8dcd91cf7e8694984f52ae4e1f0fc1737f3f09'
AND (
token = 'xzHagyF7Z2WwXWrPejFZAJw0b+NWpo/WgWqcRbp09KQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)