UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EE7kLMnB/6F3gYGqDTd/FmtBTji5xtcn5Rc+nus47mg=' 
WHERE 
  key_id = '8132b80e80cdcd1da2c72c49a4aa45864a838fe1fbafffe2f0424d226de9de3f' 
  AND (
    token = 'EE7kLMnB/6F3gYGqDTd/FmtBTji5xtcn5Rc+nus47mg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027