UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EtVaWTY88RJ3Ee9/a+A0t2lV7p+BDoCFVz/N/GOXDqQ=' 
WHERE 
  key_id = '48953c3d9f6db0ed5e2b69ddbca2ab0d5f9c5ad33cb0d4d9922ba9e87e5b0d2b' 
  AND (
    token = 'EtVaWTY88RJ3Ee9/a+A0t2lV7p+BDoCFVz/N/GOXDqQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049