UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2+yry/KEGEn2vYGvBlwtt81KiBDOBfTamher9KvVFWc=' 
WHERE 
  key_id = 'dcbaf9d6e03e84a2a781a60fabbb85431c62179c5e31a3a8f4753cdda8e46be0' 
  AND (
    token = '2+yry/KEGEn2vYGvBlwtt81KiBDOBfTamher9KvVFWc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055