UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+3APe5k2g4QyPIGWXLqsZesjbt9kSoHEcP/axUyizWI=' 
WHERE 
  key_id = '3f75c0ca53fe564e86956d64213f321c72a76a19d3ce4957ee8cd7bbc4427253' 
  AND (
    token = '+3APe5k2g4QyPIGWXLqsZesjbt9kSoHEcP/axUyizWI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034