UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WkvVAba/0h7+uDUxv30yCrygn1bDQMUeIItO5UQzA7I=' 
WHERE 
  key_id = '7759e292ead723435396754026ba965e9efb34405f515280bad57e55fcb7599a' 
  AND (
    token = 'WkvVAba/0h7+uDUxv30yCrygn1bDQMUeIItO5UQzA7I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051