UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Z7DFF0sqzTrcwYAB0/ky0Kg63EuxLc7e1Dbq4TB9lyY=' 
WHERE 
  key_id = 'dc8c453fd709132507cb935988459881add42b607e7fdda5a40f31d04ecb001b' 
  AND (
    token = 'Z7DFF0sqzTrcwYAB0/ky0Kg63EuxLc7e1Dbq4TB9lyY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031