UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Vq/kEe4WyfAoaqhEF46rdOhfuSQlhcKMPHJvdiNnrkc=' 
WHERE 
  key_id = 'f51950cfac71908575bcde1175c6da361597ae93bb99959ce6488aca16db5a63' 
  AND (
    token = 'Vq/kEe4WyfAoaqhEF46rdOhfuSQlhcKMPHJvdiNnrkc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040