UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MUkW/p/Sw6nS24qfQFNAZdIkreDPk0+zi5gBcQfW0BM=' 
WHERE 
  key_id = '323de61ce102137af86842803d4d7ea8de3469ddb8f8b7ab4d64a40645565d4e' 
  AND (
    token = 'MUkW/p/Sw6nS24qfQFNAZdIkreDPk0+zi5gBcQfW0BM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036