UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'q96+b93S5im/qoDTcj0vimcCYUon24JbazdqqLCYWnI=' 
WHERE 
  key_id = '1880f24345c86f1b7d01346bc806d504f024def9cd99e504dfb56a5087e62ae2' 
  AND (
    token = 'q96+b93S5im/qoDTcj0vimcCYUon24JbazdqqLCYWnI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027