UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HfVLRaoyYF6HQsO8JRsDPxjVvzSnEW4W07T0oYWae1M=' 
WHERE 
  key_id = '245306d2969d312174c99ba40391abff7714add68d05020738ed334be7337bb2' 
  AND (
    token = 'HfVLRaoyYF6HQsO8JRsDPxjVvzSnEW4W07T0oYWae1M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037