UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5lv88295hxTUw2VbhaHyF1JphbZp5LhirAAm5Yp+ZmU=' 
WHERE 
  key_id = '85a5386315c6dfe2343470c0e442495fd13528f40004f8074cf5f2585c459cbf' 
  AND (
    token = '5lv88295hxTUw2VbhaHyF1JphbZp5LhirAAm5Yp+ZmU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033