UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qPe/zpIO035IM3F+o8h9fk2VQla7P1JYPNEkQUMgCrc=' 
WHERE 
  key_id = 'a2df3fa66bacb7e06d814c4d04058199ef644f10326dc3307f0508017bf33af5' 
  AND (
    token = 'qPe/zpIO035IM3F+o8h9fk2VQla7P1JYPNEkQUMgCrc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036