UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uMK2NhPH4FA+i+p8sLJ6DrdFxIQqg7lDfs4NEZIFyGE=' 
WHERE 
  key_id = '56b6f0b53fb5f3e817b056a64d8ad8e7330681e8b200333869acd7112d4ee6ee' 
  AND (
    token = 'uMK2NhPH4FA+i+p8sLJ6DrdFxIQqg7lDfs4NEZIFyGE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044