UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FubmqmU0tFxJGRvgrXvDt+cPHPgChly2mvko9pjzgNE=' 
WHERE 
  key_id = '3780e105081388c020b80cf050034aafcb97ccc16b00149b213e35d73b8e8b63' 
  AND (
    token = 'FubmqmU0tFxJGRvgrXvDt+cPHPgChly2mvko9pjzgNE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017